package com.wesley.prototype;

/**
 * <h1>克隆模型 ，实现Cloneable接口</h1>
 *
 * @Date: 2021/8/12
 */
public class Sheep implements Cloneable {

    private String name;

    private String color;

    private int age;

    public Sheep() {
    }

    public Sheep(String name, String color, int age) {
        this.name = name;
        this.color = color;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "[ sheep name = " + this.name + "; age = " + this.age + "; color = " + this.color + " ]";
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
